home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.cs.arizona.edu
/
ftp.cs.arizona.edu.tar
/
ftp.cs.arizona.edu
/
icon
/
newsgrp
/
group98b.txt
/
000173_icon-group-sender _Mon Aug 31 09:30:37 1998.msg
< prev
next >
Wrap
Internet Message Format
|
2000-09-20
|
3KB
Return-Path: <icon-group-sender>
Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239])
by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) with SMTP id JAA01124
for <icon-group-addresses@baskerville.CS.Arizona.EDU>; Mon, 31 Aug 1998 09:30:36 -0700 (MST)
Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM)
id AA20694; Mon, 31 Aug 1998 09:30:10 -0700
Date: Mon, 31 Aug 1998 09:11:59 -0700
From: kwalker@sfo.harbinger.com (Ken Walker)
Message-Id: <199808311611.JAA20585@varda.premenos.com>
To: icon-group@optima.CS.Arizona.EDU
Subject: Re: A hood fan is guard to mind.
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Content-Md5: 0iWoS3eDDqPo4J69Q7wyKA==
Content-Transfer-Encoding: 7bit
Content-Transfer-Encoding: 7bit
Errors-To: icon-group-errors@optima.CS.Arizona.EDU
Content-Transfer-Encoding: 7bit
Status: RO
Content-Length: 1524
I apologize. The version of the program I sent out did not have
a procedure that generated results, so it was not a recursive generator.
Here is a version that is.
procedure main()
local fillers, firstChar, remainingChars
#
# The sentence is broken into three categories:
# parts not participating in the substitution
# the initial characters of the words involved in substitution
# the tail of the words involved in substitution
#
fillers := ["A ", " ", " is ", " to ", "."]
firstChar := ["g", "m", "h", "f"]
remainingChars := ["ood", "an", "ard", "ind"]
every write(polyspoonerism(fillers, firstChar, remainingChars, ""))
end
procedure polyspoonerism(
fillers, # words before each participating word
firstChar, # first characters to use in substitutions
remainingChars, # words (w/out 1st char) that are participating
sentence) # sentence so far
local indx
if *remainingChars = 0 then
return sentence || (fillers[1] | "")
#
# Use each of the remaining first characters
#
every indx := 1 to *firstChar do {
#
# Add the next set of parts to the sentence then call
# the function recursively.
#
suspend polyspoonerism(fillers[2:0],
firstChar[1:indx] ||| firstChar[indx+1:0],
remainingChars[2:0],
sentence || fillers[1] || firstChar[indx] || remainingChars[1])
}
end
Ken Walker, kenneth.walker@sfo.harbinger.com
Harbinger Coporation, Concord, Ca. 94520